package cn.gson.springmvc.model.pojos;

import javax.persistence.*;
import java.sql.Date;
import java.util.Collection;
import java.util.Objects;

@Entity
public class Operarrange {
    private int operarrangeId;
    private Integer operdetId;
    private Integer operarrangeTotal;
    private Integer operarrangeState;
    private Date operarrangeDate;
    private Operating operatingByOperatingId;
    private Hospinfo hospinfoByHospinfoId;

    @Id
    @Column(name = "operarrange_id", nullable = false)
    public int getOperarrangeId() {
        return operarrangeId;
    }

    public void setOperarrangeId(int operarrangeId) {
        this.operarrangeId = operarrangeId;
    }

    @Basic
    @Column(name = "operdet_id", nullable = true)
    public Integer getOperdetId() {
        return operdetId;
    }

    public void setOperdetId(Integer operdetId) {
        this.operdetId = operdetId;
    }

    @Basic
    @Column(name = "operarrange_total", nullable = true, precision = 0)
    public Integer getOperarrangeTotal() {
        return operarrangeTotal;
    }

    public void setOperarrangeTotal(Integer operarrangeTotal) {
        this.operarrangeTotal = operarrangeTotal;
    }

    @Basic
    @Column(name = "operarrange_state", nullable = true)
    public Integer getOperarrangeState() {
        return operarrangeState;
    }

    public void setOperarrangeState(Integer operarrangeState) {
        this.operarrangeState = operarrangeState;
    }

    @Basic
    @Column(name = "operarrange_date", nullable = true)
    public Date getOperarrangeDate() {
        return operarrangeDate;
    }

    public void setOperarrangeDate(Date operarrangeDate) {
        this.operarrangeDate = operarrangeDate;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Operarrange that = (Operarrange) o;
        return operarrangeId == that.operarrangeId &&
                Objects.equals(operdetId, that.operdetId) &&
                Objects.equals(operarrangeTotal, that.operarrangeTotal) &&
                Objects.equals(operarrangeState, that.operarrangeState) &&
                Objects.equals(operarrangeDate, that.operarrangeDate);
    }

    @Override
    public int hashCode() {
        return Objects.hash(operarrangeId, operdetId, operarrangeTotal, operarrangeState, operarrangeDate);
    }



    @ManyToOne
    @JoinColumn(name = "operating_id", referencedColumnName = "operating_id")
    public Operating getOperatingByOperatingId() {
        return operatingByOperatingId;
    }

    public void setOperatingByOperatingId(Operating operatingByOperatingId) {
        this.operatingByOperatingId = operatingByOperatingId;
    }

    @ManyToOne
    @JoinColumn(name = "hospinfo_id", referencedColumnName = "hospinfo_id")
    public Hospinfo getHospinfoByHospinfoId() {
        return hospinfoByHospinfoId;
    }

    public void setHospinfoByHospinfoId(Hospinfo hospinfoByHospinfoId) {
        this.hospinfoByHospinfoId = hospinfoByHospinfoId;
    }


}
